<extend name="../Public/base" />
<block name="title">{$TITLE}列表</block>
<block name="nav"><i class="Hui-iconfont">&#xe67f;</i> 系统 <span class="c-gray en">&gt;</span> 管理员管理 <span class="c-gray en">&gt;</span> {$TITLE}列表</block>
<block name="body">
    <form method="post">
        <div class="text-c">
            <label>菜单分类：</label>
            <span class="select-box inline">
               <select class="select" name="cate_id" style="width: 150px">
                    <volist name="navCates" id="info">
                        <option value="{$info.cate_id}" <eq name="info.cate_id" value="$detail[cate_id]">selected="selected"</eq>>{$info.cate_name}</option>
                    </volist>
               </select>
            </span>
            <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </div>
    </form>
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <a title="添加菜单" href="javascript:;" CLASS="btn btn-primary radius" onclick="layer_show('添加{$TITLE}','{:U('add',array('parent_id'=>$var['nav_id']))}','800','580')">
                <i class="Hui-iconfont">&#xe600;</i> 添加{$TITLE}
            </a>
        </span>
        <span class="r"><button class="btn btn-default radius" type="submit"><i class="Hui-iconfont">&#xe68f;</i> 更新排序</button></span>
     </div>
    <form action="{:U('Nav/updateSort')}" method="post">
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg">
                <thead>
                    <tr class="text-c">
                        <th width="5%">ID</th>
                        <th width="25%">排序</th>
                        <th width="40%">{$TITLE}名称</th>
                        <th width="10%">状态</th>
                        <th width="20%">操作</th>
                    </tr>
                </thead>
            <tbody>
            <foreach name="navs" item="var">
                <tr>
                    <td class="text-c">{$var.nav_id}</td>
                    <td>
                        <input name="sorts[{$var.nav_id}]" value="{$var.sort}" type="text" class="input-text text-c"  style="width: 120px" />
                    </td>
                    <td>{$var.nav_name}</td>
                    <td class="text-c">
                        <eq name='var.status' value='1'>
                            <span class="label label-success radius">已启用</span>
                            <else/>
                            <span class="label radius">已停用</span>
                        </eq>
                    </td>
                    <td class="text-c">
                       <a title="添加子菜单" href="javascript:;" onclick="layer_show('添加子菜单','{:U('add',array('parent_id'=>$var['nav_id']))}','800','580')">
                           添加子菜单
                        </a>
                        <eq name='var.status' value='1'>
                            <a  onclick="change_status('{$var.nav_id}')" href="javascript:;" title="停用" class="ml-5"><i class="Hui-iconfont">&#xe631;</i></a>
                            <else/>
                            <a  onclick="change_status('{$var.nav_id}')" href="javascript:;" title="启用" class="ml-5"><i class="Hui-iconfont">&#xe615;</i></a>
                        </eq>
                        <a title="编辑" href="javascript:;" onclick="layer_show('编辑{$TITLE}','{:U('edit',array('nav_id'=>$var['nav_id']))}','800','580')" class="ml-5">
                            <i class="Hui-iconfont">&#xe6df;</i>
                        </a>
                        <a title="删除" href="javascript:;" onclick="del('{$var['nav_id']}','nav_id')" class="ml-5">
                            <i class="Hui-iconfont">&#xe6e2;</i>
                        </a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
    </div>
    <div class='paging_simple_numbers'>
        {$page}
    </div>
  </form>
</block>
<block name="js">
    <script type="text/javascript">
        function change_status(id) {
            action('确认要改变菜单状态吗？',id,"{:U('changeStatus')}",'nav_id');
        }
    </script>
</block>